blob: 25651b2f2b238455f7ce690beef60fa2bfe5a269 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
import { Separator } from "@/components/ui/separator"
import { type SearchParams } from "@/types/table"
import * as React from "react"
import { getValidFilters } from "@/lib/data-table"
import { searchParamsCache } from "@/lib/admin-users/validations"
import { getAllRoles, getUsersEVCP } from "@/lib/users/service"
import { getUserCountGroupByRole } from "@/lib/admin-users/service"
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
import { UserTable } from "@/lib/users/table/users-table"
interface IndexPageProps {
searchParams: Promise<SearchParams>
}
export default async function SystemUserPage(props: IndexPageProps) {
const searchParams = await props.searchParams
const search = searchParamsCache.parse(searchParams)
const validFilters = getValidFilters(search.filters)
const promises = Promise.all([
getUsersEVCP({
...search,
filters: validFilters,
}),
getUserCountGroupByRole(),
getAllRoles()
])
return (
<React.Suspense
fallback={
<DataTableSkeleton
columnCount={6}
searchableColumnCount={1}
filterableColumnCount={2}
cellWidths={["10rem", "12rem", "12rem", "12rem"]}
shrinkZero
/>
}
>
<div className="space-y-6">
<div>
<h3 className="text-lg font-medium">SHI Users</h3>
</div>
<Separator />
<UserTable promises={promises} />
</div>
</React.Suspense>
)
}
|